package com.xujiang.imitationcompanypj.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by xujiang on 2017/4/5.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class User {


    @JsonIgnore
    private Type type;

    @JsonProperty("userid")
    private String userId;
    @JsonProperty("userHeadPortrait")
    private String userPortrait;
    @JsonProperty("userNickName")
    private String userNickName;
    private String userSignature;



    public enum Type{
        ADMIN,MEMBER
    }

    public User(User user,Type type){
        this(user.getUserId(),user.getUserPortrait(),user.getUserNickName(),user.getUserSignature());
        this.type = type;
    }

    public User(){

    }

    public User(String userId, String userPortrait, String userNickName, String userSignature){
        this.userId = userId;
        this.userPortrait = userPortrait;
        this.userNickName = userNickName;
        this.userSignature = userSignature;
    }


    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserPortrait() {
        return userPortrait;
    }

    public void setUserPortrait(String userPortrait) {
        this.userPortrait = userPortrait;
    }

    public String getUserNickName() {
        return userNickName;
    }

    public void setUserNickName(String userNickName) {
        this.userNickName = userNickName;
    }

    public String getUserSignature() {
        return userSignature;
    }

    public void setUserSignature(String userSignature) {
        this.userSignature = userSignature;
    }

    @Override
    public String toString() {
        return "User{" +
                "type=" + type +
                ", userId='" + userId + '\'' +
                ", userPortrait='" + userPortrait + '\'' +
                ", userNickName='" + userNickName + '\'' +
                ", userSignature='" + userSignature + '\'' +
                '}';
    }
}
